package coms.action;


import coms.delegates.ConferenceDelegate;
import coms.delegates.EventDelegate;
import coms.dto.Conference;
import coms.dto.*;
import java.util.List;

public class HomeAction extends ComsActionSupport{
    private List<Conference> conferences;
    private List<Event> events;
    private String name;
    
    
    public HomeAction() {
    }
    
    public String home() throws Exception {
        
        ConferenceDelegate delegate = new ConferenceDelegate();
        conferences = delegate.findAll();
        EventDelegate eventDelegate = new EventDelegate();
        events = eventDelegate.findAll();
        User usr = (User)session.get("user");
        if(usr==null)
            return "error";
        name="";
        name+=usr.getFullname();
        return "home";
    }
    
    public List<Conference> getConferences() {
        return conferences;
    }

    public void setConferences(List<Conference> conferences) {
        this.conferences = conferences;
    }

    public List<Event> getEvents() {
        return events;
    }

    public void setEvents(List<Event> events) {
        this.events = events;
    }
    
}
